//
// Created by bleedingfight on 2020/7/8.
//

#include "MyStack.h"
void MyStack::push(int x) {
    m_data.push(x);
    int size = m_data.size();
    while (size>1){
        int top_value = m_data.front();
        m_data.pop();
        m_data.push(top_value);
        size--;
    }
}
bool MyStack::empty() {
    return m_data.empty();
}
int MyStack::pop() {
    int top_value = m_data.front();
    m_data.pop();
    return top_value;
}
int MyStack::top() {
    return m_data.front();
}